#ifndef TRANSFORMATION_H_
#define TRANSFORMATION_H_

#include <vector>
#include <stdint.h>
#include "Graphics.h"
#include "Geo.h"

namespace opennav {

class Transformation {
public:
	Transformation();

	void set_rotation(float rotation);
	float rotation() const;
	void set_scale(float scale);
	float scale() const;
	void set_map_center(Coordinate& coordinate);
	Coordinate map_center() const;
	void set_screen_center(Point& point);
	Point screen_center() const;
	void setup();
	Point transform(const opennav::Coordinate& coordinate) const;
	void transform(const std::vector<opennav::Coordinate>& coordinates, std::vector<opennav::Point>& points) const;
	Coordinate inv_transform(const opennav::Point& point) const;
private:
	Coordinate map_center_;
	Point screen_center_;
	int m00, m01, m10, m11;
	double im00, im01, im10, im11;
	float scale_;
	float rotation_;
	int shift_;
	const static int SHIFT = 8;
};

}

#endif /* TRANSFORMATION_H_ */
